//just paint a 2D line on screen
#version 460

layout (push_constant) uniform SPushConstants
{
    vec4 Color;
    vec2 Center; //in pixels, in window content space
    float Radius; //in pixels
    float ZOrder;
} PushConstants;

layout (location = 0) out vec4 OutColor;
layout (location = 1) out vec2 OutCenter;
layout (location = 2) out float OutRadius;

void main()
{
    vec2 Position[4];
    // Position[0]=vec2(PushConstants.Center.x-PushConstants.Radius,PushConstants.Center.y-PushConstants.Radius);
    // Position[1]=vec2(PushConstants.Center.x+PushConstants.Radius,PushConstants.Center.y-PushConstants.Radius);
    // Position[2]=vec2(PushConstants.Center.x-PushConstants.Radius,PushConstants.Center.y+PushConstants.Radius);
    // Position[3]=vec2(PushConstants.Center.x+PushConstants.Radius,PushConstants.Center.y+PushConstants.Radius);

    Position[0]=vec2(-1,-1);
    Position[1]=vec2(1,-1);
    Position[2]=vec2(-1,1);
    Position[3]=vec2(1,1);

    gl_Position =vec4(Position[gl_VertexIndex],PushConstants.ZOrder ,1);

    OutColor = PushConstants.Color;

    OutCenter = PushConstants.Center;
    OutRadius = PushConstants.Radius;
}